﻿//==================================================================
// Copyright (C) 2011 深圳市中旭企业管理股份有限公司
// 文件名: V_CrmDeliverMajorProInfo.cs
// 作 者：代码自动生成
// 日 期：2012-12-4 14:05:10
// 描 述：
// 版 本：1.00
// 修改历史纪录
// 版 本  修改时间      修改人            修改内容
// 1.00             
//==================================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using System.Text;
using Csla;
using lite;
using Csla.Validation;
using Csla.Data;
using System.Data.SqlClient;
using ZX.DAL;
using OpenExpressApp.ORM;

namespace ZX.CRM.Library
{
    /// <summary>
    /// 
    /// </summary>
    [Serializable]
    [Table(Name = "V_CrmDeliverMajorProInfo")]
    [ZX.DBModule.Table("V_CrmDeliverMajorProInfo", "ID")]
    public class V_CrmDeliverMajorProInfo : ZX.DBModule.BaseEntity
    {
        #region Business Methods 业务方法
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> IDProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<Guid>("ID"));
        [DataObjectField(true, true)]
        [Column, PK]
        public Guid ID
        {
            get { return GetProperty(IDProperty); }
            set { SetProperty(IDProperty, value); }
        }

        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CodeProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("Code"));
        [Column]
        public string Code
        {
            get { return GetProperty(CodeProperty); }
            set { SetProperty(CodeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<decimal> ResignMoneyProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<decimal>("ResignMoney"));
        [Column]
        public decimal ResignMoney
        {
            get { return GetProperty(ResignMoneyProperty); }
            set { SetProperty(ResignMoneyProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<decimal> AccountReceivableProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<decimal>("AccountReceivable"));
        [Column]
        public decimal AccountReceivable
        {
            get { return GetProperty(AccountReceivableProperty); }
            set { SetProperty(AccountReceivableProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<DateTime> AddTimeProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<DateTime>("AddTime"));
        [Column]
        public DateTime AddTime
        {
            get { return GetProperty(AddTimeProperty); }
            set { SetProperty(AddTimeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> UNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("UName"));
        [Column]
        public string UName
        {
            get { return GetProperty(UNameProperty); }
            set { SetProperty(UNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> FzjfNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("FzjfName"));
        [Column]
        public string FzjfName
        {
            get { return GetProperty(FzjfNameProperty); }
            set { SetProperty(FzjfNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> ClassFrontServerProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<Guid>("ClassFrontServer"));
        [Column]
        public Guid ClassFrontServer
        {
            get { return GetProperty(ClassFrontServerProperty); }
            set { SetProperty(ClassFrontServerProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> OrderCodeProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("OrderCode"));
        [Column]
        public string OrderCode
        {
            get { return GetProperty(OrderCodeProperty); }
            set { SetProperty(OrderCodeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CustomerCodeProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("CustomerCode"));
        [Column]
        public string CustomerCode
        {
            get { return GetProperty(CustomerCodeProperty); }
            set { SetProperty(CustomerCodeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CustomerNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("CustomerName"));
        [Column]
        public string CustomerName
        {
            get { return GetProperty(CustomerNameProperty); }
            set { SetProperty(CustomerNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> PMNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("PMName"));
        [Column]
        public string PMName
        {
            get { return GetProperty(PMNameProperty); }
            set { SetProperty(PMNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<DateTime> BeginDateProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<DateTime>("BeginDate"));
        [Column]
        public DateTime BeginDate
        {
            get { return GetProperty(BeginDateProperty); }
            set { SetProperty(BeginDateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<int> WellDegreeProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<int>("WellDegree"));
        [Column]
        public int WellDegree
        {
            get { return GetProperty(WellDegreeProperty); }
            set { SetProperty(WellDegreeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> DegreeUserProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<Guid>("DegreeUser"));
        [Column]
        public Guid DegreeUser
        {
            get { return GetProperty(DegreeUserProperty); }
            set { SetProperty(DegreeUserProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<DateTime> DegreeDateProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<DateTime>("DegreeDate"));
        [Column]
        public DateTime DegreeDate
        {
            get { return GetProperty(DegreeDateProperty); }
            set { SetProperty(DegreeDateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> MarketNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("MarketName"));
        [Column]
        public string MarketName
        {
            get { return GetProperty(MarketNameProperty); }
            set { SetProperty(MarketNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> ProjectUserProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<Guid>("ProjectUser"));
        [Column]
        public Guid ProjectUser
        {
            get { return GetProperty(ProjectUserProperty); }
            set { SetProperty(ProjectUserProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<DateTime> ProjectDateProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<DateTime>("ProjectDate"));
        [Column]
        public DateTime ProjectDate
        {
            get { return GetProperty(ProjectDateProperty); }
            set { SetProperty(ProjectDateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<decimal> AmountProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<decimal>("Amount"));
        [Column]
        public decimal Amount
        {
            get { return GetProperty(AmountProperty); }
            set { SetProperty(AmountProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> PMProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<Guid>("PM"));
        [Column]
        public Guid PM
        {
            get { return GetProperty(PMProperty); }
            set { SetProperty(PMProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> PMememberProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("PMemember"));
        [Column]
        public string PMemember
        {
            get { return GetProperty(PMememberProperty); }
            set { SetProperty(PMememberProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> PExplainProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("PExplain"));
        [Column]
        public string PExplain
        {
            get { return GetProperty(PExplainProperty); }
            set { SetProperty(PExplainProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<decimal> DateSumProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<decimal>("DateSum"));
        [Column]
        public decimal DateSum
        {
            get { return GetProperty(DateSumProperty); }
            set { SetProperty(DateSumProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<DateTime> EndDateProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<DateTime>("EndDate"));
        [Column]
        public DateTime EndDate
        {
            get { return GetProperty(EndDateProperty); }
            set { SetProperty(EndDateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> SsUserProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<Guid>("SsUser"));
        [Column]
        public Guid SsUser
        {
            get { return GetProperty(SsUserProperty); }
            set { SetProperty(SsUserProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<DateTime> SsDateProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<DateTime>("SsDate"));
        [Column]
        public DateTime SsDate
        {
            get { return GetProperty(SsDateProperty); }
            set { SetProperty(SsDateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> SsExplainProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("SsExplain"));
        [Column]
        public string SsExplain
        {
            get { return GetProperty(SsExplainProperty); }
            set { SetProperty(SsExplainProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> AddUserProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<Guid>("AddUser"));
        [Column]
        public Guid AddUser
        {
            get { return GetProperty(AddUserProperty); }
            set { SetProperty(AddUserProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> ExplainProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("Explain"));
        [Column]
        public string Explain
        {
            get { return GetProperty(ExplainProperty); }
            set { SetProperty(ExplainProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> WorkTaskInsIdProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("WorkTaskInsId"));
        [Column]
        public string WorkTaskInsId
        {
            get { return GetProperty(WorkTaskInsIdProperty); }
            set { SetProperty(WorkTaskInsIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> WorkTaskIdProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("WorkTaskId"));
        [Column]
        public string WorkTaskId
        {
            get { return GetProperty(WorkTaskIdProperty); }
            set { SetProperty(WorkTaskIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> WorkFlowIdProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("WorkFlowId"));
        [Column]
        public string WorkFlowId
        {
            get { return GetProperty(WorkFlowIdProperty); }
            set { SetProperty(WorkFlowIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> WorkFlowInsIdProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("WorkFlowInsId"));
        [Column]
        public string WorkFlowInsId
        {
            get { return GetProperty(WorkFlowInsIdProperty); }
            set { SetProperty(WorkFlowInsIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> ProductNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("ProductName"));
        [Column]
        public string ProductName
        {
            get { return GetProperty(ProductNameProperty); }
            set { SetProperty(ProductNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> TypeNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("TypeName"));
        [Column]
        public string TypeName
        {
            get { return GetProperty(TypeNameProperty); }
            set { SetProperty(TypeNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> AddPmNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("AddPmName"));
        [Column]
        public string AddPmName
        {
            get { return GetProperty(AddPmNameProperty); }
            set { SetProperty(AddPmNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> StudentNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("StudentName"));
        [Column]
        public string StudentName
        {
            get { return GetProperty(StudentNameProperty); }
            set { SetProperty(StudentNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> SsUNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("SsUName"));
        [Column]
        public string SsUName
        {
            get { return GetProperty(SsUNameProperty); }
            set { SetProperty(SsUNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<int> ServiceSatisfyProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<int>("ServiceSatisfy"));
        [Column]
        public int ServiceSatisfy
        {
            get { return GetProperty(ServiceSatisfyProperty); }
            set { SetProperty(ServiceSatisfyProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<int> AdvisorIsAtProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<int>("AdvisorIsAt"));
        [Column]
        public int AdvisorIsAt
        {
            get { return GetProperty(AdvisorIsAtProperty); }
            set { SetProperty(AdvisorIsAtProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<DateTime> ServiceDateProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<DateTime>("ServiceDate"));
        [Column]
        public DateTime ServiceDate
        {
            get { return GetProperty(ServiceDateProperty); }
            set { SetProperty(ServiceDateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> ServiceNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("ServiceName"));
        [Column]
        public string ServiceName
        {
            get { return GetProperty(ServiceNameProperty); }
            set { SetProperty(ServiceNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<int> UnSatisfyProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<int>("UnSatisfy"));
        [Column]
        public int UnSatisfy
        {
            get { return GetProperty(UnSatisfyProperty); }
            set { SetProperty(UnSatisfyProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<DateTime> ProjectRestartDateProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<DateTime>("ProjectRestartDate"));
        [Column]
        public DateTime ProjectRestartDate
        {
            get { return GetProperty(ProjectRestartDateProperty); }
            set { SetProperty(ProjectRestartDateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<DateTime> ProejectPauseDateProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<DateTime>("ProejectPauseDate"));
        [Column]
        public DateTime ProejectPauseDate
        {
            get { return GetProperty(ProejectPauseDateProperty); }
            set { SetProperty(ProejectPauseDateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<DateTime> LeaveProjectDateProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<DateTime>("LeaveProjectDate"));
        [Column]
        public DateTime LeaveProjectDate
        {
            get { return GetProperty(LeaveProjectDateProperty); }
            set { SetProperty(LeaveProjectDateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<decimal> SucceedDegreeProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<decimal>("SucceedDegree"));
        [Column]
        public decimal SucceedDegree
        {
            get { return GetProperty(SucceedDegreeProperty); }
            set { SetProperty(SucceedDegreeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> DliverStateProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<Guid>("DliverState"));
        [Column]
        public Guid DliverState
        {
            get { return GetProperty(DliverStateProperty); }
            set { SetProperty(DliverStateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> PhraseTextProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("PhraseText"));
        [Column]
        public string PhraseText
        {
            get { return GetProperty(PhraseTextProperty); }
            set { SetProperty(PhraseTextProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> ProductCodeProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("ProductCode"));
        [Column]
        public string ProductCode
        {
            get { return GetProperty(ProductCodeProperty); }
            set { SetProperty(ProductCodeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> OrderIDProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<Guid>("OrderID"));
        [Column]
        public Guid OrderID
        {
            get { return GetProperty(OrderIDProperty); }
            set { SetProperty(OrderIDProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> ProductIdProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<Guid>("ProductId"));
        [Column]
        public Guid ProductId
        {
            get { return GetProperty(ProductIdProperty); }
            set { SetProperty(ProductIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> CustomerIdProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<Guid>("CustomerId"));
        [Column]
        public Guid CustomerId
        {
            get { return GetProperty(CustomerIdProperty); }
            set { SetProperty(CustomerIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> OrderProductIDProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<Guid>("OrderProductID"));
        [Column]
        public Guid OrderProductID
        {
            get { return GetProperty(OrderProductIDProperty); }
            set { SetProperty(OrderProductIDProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> CustomeerMgrProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<Guid>("CustomeerMgr"));
        [Column]
        public Guid CustomeerMgr
        {
            get { return GetProperty(CustomeerMgrProperty); }
            set { SetProperty(CustomeerMgrProperty, value); }
        }

        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> CustomerMgrProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<Guid>("CustomerMgr"));
        [Column]
        public Guid CustomerMgr
        {
            get { return GetProperty(CustomerMgrProperty); }
            set { SetProperty(CustomerMgrProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> CustomerDirectorProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<Guid>("CustomerDirector"));
        [Column]
        public Guid CustomerDirector
        {
            get { return GetProperty(CustomerDirectorProperty); }
            set { SetProperty(CustomerDirectorProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> CustomerManagerProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<Guid>("CustomerManager"));
        [Column]
        public Guid CustomerManager
        {
            get { return GetProperty(CustomerManagerProperty); }
            set { SetProperty(CustomerManagerProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CustomerMgrNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("CustomerMgrName"));
        [Column]
        public string CustomerMgrName
        {
            get { return GetProperty(CustomerMgrNameProperty); }
            set { SetProperty(CustomerMgrNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CustomerDirectorNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("CustomerDirectorName"));
        [Column]
        public string CustomerDirectorName
        {
            get { return GetProperty(CustomerDirectorNameProperty); }
            set { SetProperty(CustomerDirectorNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CustomerManagerNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorProInfo), new PropertyInfo<string>("CustomerManagerName"));
        [Column]
        public string CustomerManagerName
        {
            get { return GetProperty(CustomerManagerNameProperty); }
            set { SetProperty(CustomerManagerNameProperty, value); }
        }
        #endregion

        #region Validation Rules 验证规则
        //将验证规则与业务对象的属性联系在一起
        protected override void AddBusinessRules()
        {
            //AddRule的第一个参数是委托变量，也就是说是方法的变量
            ValidationRules.AddRule(CommonRules.StringRequired, "Code");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Code", 15));
            ValidationRules.AddRule(CommonRules.StringRequired, "UName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("UName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "FzjfName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("FzjfName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "OrderCode");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("OrderCode", 15));
            ValidationRules.AddRule(CommonRules.StringRequired, "CustomerCode");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CustomerCode", 15));
            ValidationRules.AddRule(CommonRules.StringRequired, "CustomerName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CustomerName", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "PMName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("PMName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "MarketName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("MarketName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "PMemember");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("PMemember", 1000));
            ValidationRules.AddRule(CommonRules.StringRequired, "PExplain");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("PExplain", 200));
            ValidationRules.AddRule(CommonRules.StringRequired, "SsExplain");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("SsExplain", 200));
            ValidationRules.AddRule(CommonRules.StringRequired, "Explain");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Explain", 200));
            ValidationRules.AddRule(CommonRules.StringRequired, "WorkTaskInsId");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("WorkTaskInsId", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "WorkTaskId");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("WorkTaskId", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "WorkFlowId");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("WorkFlowId", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "WorkFlowInsId");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("WorkFlowInsId", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "ProductName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("ProductName", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "TypeName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("TypeName", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "AddPmName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("AddPmName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "StudentName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("StudentName", -1));
            ValidationRules.AddRule(CommonRules.StringRequired, "SsUName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("SsUName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "ServiceName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("ServiceName", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "PhraseText");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("PhraseText", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "ProductCode");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("ProductCode", 10));
            //base.AddBusinessRules();
        }
        #endregion

        #region Factory Methods 工厂方法

        public V_CrmDeliverMajorProInfo() { }

        public static V_CrmDeliverMajorProInfo New()
        {
            return DataPortal.Create<V_CrmDeliverMajorProInfo>();
        }
        public static V_CrmDeliverMajorProInfo Get(Guid ID)
        {
            return DataPortal.Fetch<V_CrmDeliverMajorProInfo>(new SingleLazyCriteria<V_CrmDeliverMajorProInfo, Guid>(ID, false));
        }
        public static void Delete(Guid ID)
        {
            DataPortal.Delete(ID);
        }

        #endregion

        #region Data Access 数据访问
        //由于DataPortal_create中没有对数据库的访问，所有标记了Runlocal特性，使得该方法只需在本地运行即可
        //如果代码中有访问数据库的方法，那么就不要用这个特性，使数据门户可以根据情况将此方法的运行选择在应用服务器还是本地
        [RunLocal()]
        protected override void DataPortal_Create()
        {
            //在此调用CheckRules对所有的属性进行验证规则的检查，这样检查只运行一次。
            ValidationRules.CheckRules();
        }


        //可以看到此方法没有标记任何特性
        //此方法要访问数据库所以不能标记本地，由于她没有任何数据库更新操作所以也无需事务性的保护
        //此方法调用结束后会隐含的调用MarkOld（）方法
        private void DataPortal_Fetch(Guid ID)
        {
            //通过连接字符串建立SQL连接对象，Using符号代表，范围释放的意思，SqlConnection对象会在此范围后被释放掉
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(ConnectionStringNames))
            {
                IDb db = DbFactory.Instance.GetDb(ctx.Connection);
                IQuery q = db.Query();
                q.Constrain("ID").Equal(ID);

                var data = db.Select<V_CrmDeliverMajorProInfo>(q)[0];
                LoadProperty(IDProperty, data.ID);
                LoadProperty(CodeProperty, data.Code);
                LoadProperty(ResignMoneyProperty, data.ResignMoney);
                LoadProperty(AccountReceivableProperty, data.AccountReceivable);
                LoadProperty(AddTimeProperty, data.AddTime);
                LoadProperty(UNameProperty, data.UName);
                LoadProperty(FzjfNameProperty, data.FzjfName);
                LoadProperty(ClassFrontServerProperty, data.ClassFrontServer);
                LoadProperty(OrderCodeProperty, data.OrderCode);
                LoadProperty(CustomerCodeProperty, data.CustomerCode);
                LoadProperty(CustomerNameProperty, data.CustomerName);
                LoadProperty(PMNameProperty, data.PMName);
                LoadProperty(BeginDateProperty, data.BeginDate);
                LoadProperty(WellDegreeProperty, data.WellDegree);
                LoadProperty(DegreeUserProperty, data.DegreeUser);
                LoadProperty(DegreeDateProperty, data.DegreeDate);
                LoadProperty(MarketNameProperty, data.MarketName);
                LoadProperty(ProjectUserProperty, data.ProjectUser);
                LoadProperty(ProjectDateProperty, data.ProjectDate);
                LoadProperty(AmountProperty, data.Amount);
                LoadProperty(PMProperty, data.PM);
                LoadProperty(PMememberProperty, data.PMemember);
                LoadProperty(PExplainProperty, data.PExplain);
                LoadProperty(DateSumProperty, data.DateSum);
                LoadProperty(EndDateProperty, data.EndDate);
                LoadProperty(SsUserProperty, data.SsUser);
                LoadProperty(SsDateProperty, data.SsDate);
                LoadProperty(SsExplainProperty, data.SsExplain);
                LoadProperty(AddUserProperty, data.AddUser);
                LoadProperty(ExplainProperty, data.Explain);
                LoadProperty(WorkTaskInsIdProperty, data.WorkTaskInsId);
                LoadProperty(WorkTaskIdProperty, data.WorkTaskId);
                LoadProperty(WorkFlowIdProperty, data.WorkFlowId);
                LoadProperty(WorkFlowInsIdProperty, data.WorkFlowInsId);
                LoadProperty(ProductNameProperty, data.ProductName);
                LoadProperty(TypeNameProperty, data.TypeName);
                LoadProperty(AddPmNameProperty, data.AddPmName);
                LoadProperty(StudentNameProperty, data.StudentName);
                LoadProperty(SsUNameProperty, data.SsUName);
                LoadProperty(ServiceSatisfyProperty, data.ServiceSatisfy);
                LoadProperty(AdvisorIsAtProperty, data.AdvisorIsAt);
                LoadProperty(ServiceDateProperty, data.ServiceDate);
                LoadProperty(ServiceNameProperty, data.ServiceName);
                LoadProperty(UnSatisfyProperty, data.UnSatisfy);
                LoadProperty(ProjectRestartDateProperty, data.ProjectRestartDate);
                LoadProperty(ProejectPauseDateProperty, data.ProejectPauseDate);
                LoadProperty(LeaveProjectDateProperty, data.LeaveProjectDate);
                LoadProperty(SucceedDegreeProperty, data.SucceedDegree);
                LoadProperty(DliverStateProperty, data.DliverState);
                LoadProperty(PhraseTextProperty, data.PhraseText);
                LoadProperty(ProductCodeProperty, data.ProductCode);
                LoadProperty(OrderIDProperty, data.OrderID);
                LoadProperty(ProductIdProperty, data.ProductId);
                LoadProperty(CustomerIdProperty, data.CustomerId);
                LoadProperty(OrderProductIDProperty, data.OrderProductID);
                LoadProperty(CustomeerMgrProperty, data.CustomeerMgr);
                LoadProperty(CustomerMgrProperty, data.CustomerMgr);
                LoadProperty(CustomerDirectorProperty, data.CustomerDirector);
                LoadProperty(CustomerManagerProperty, data.CustomerManager);
                LoadProperty(CustomerMgrNameProperty, data.CustomerMgrName);
                LoadProperty(CustomerDirectorNameProperty, data.CustomerDirectorName);
                LoadProperty(CustomerManagerNameProperty, data.CustomerManagerName);
            }
        }

        [Transactional(TransactionalTypes.TransactionScope)]
        protected override void DataPortal_DeleteSelf()
        {
            //依然是调用下面的方法删除的，只是他此时可以获得自己的Id
            DataPortal_Delete(IDProperty);
        }
        #endregion
    }
}

